@extends('web.master')
@section('title','活动详情')
    @section('head')
        <link rel="stylesheet" href="{{asset('statics/css/index.css')}}" />
        <script type="text/javascript" src="{{asset('statics/js/TouchSlide.1.1.js')}}"></script>
        <style>
            .focus .bd li {
                background: url('{{$detail->thumb}}') no-repeat center;
                background-size: cover;
                width: 100%;
                height: 160px;
            }

        </style>
        @endsection
@section('content')
    <!--轮播图-->
    <div id="content">
        <div id="focus" class="focus">
            <div class="hd">
                <ul></ul>
            </div>
            <div class="bd">
                <ul>
                    <li></li>
                    <li></li>
                    <li></li>
                </ul>
            </div>
        </div>
        <script type="text/javascript">
            TouchSlide({
                slideCell: "#focus",
                titCell: ".hd ul", //开启自动分页
                mainCell: ".bd ul",
                effect: "left",
                autoPlay: true, //自动播放
                autoPage: true, //自动分页
            });
        </script>
    </div>
    <!--头部信息-->
    <div class="activityTop">
        <p class="title">
            {{$detail->title}}
        </p>
        <p class="time">{{$detail->created_at}}</p>
        <div class="other">
            <span class="tip"><i></i>活动时间</span>
            <span class="orange">{{$detail->start_time}}-{{$detail->end_time}}</span>
        </div>
    </div>
    <!--套餐优惠-->
    <div class="activityCont">
        <div class="other">
            <span class="tip"><i></i>套餐优惠</span>
            <span class="tip">{{($detail->rebate)/10}}折</span>
            <span class="tip">@if($detail->start_time >\Carbon\Carbon::now())活动进行时 @elseif($detail->end_time>\Carbon\Carbon::now()) 活动已结束 @else 活动未开始  @endif</span>
        </div>
        <ul class="activityList">
            @if(count($detail->combo)>0)
                @foreach($detail->combo as $v)
                    @if($v->status==\App\Http\Controllers\Admin\Business\Service\Combo::ON)
                    <a href="{{route('combo_detail',['id'=>$v->id])}}">
            <li>
                <div class="img" style="background: url('{{asset('storage/'.$v->thumb)}}')"></div>
                <div class="cont">
                    <p>{{$v->title}}</p>
                    <div class="orange">
                        <b><span>￥</span>{{($detail->rebate*$v->price)/100}}</b>
                        <b>{{$v->times}}<span>次</span></b>
                        <i>¥{{$v->price}}  {{$v->times}}次</i>
                    </div>
                </div>
            </li>
                    </a>
                    @endif
                @endforeach
     @endif
        </ul>
    </div>
    <!--详情-->
    <div class="activityDet">
        <div class="other">
            <span class="tip"><i></i>简单描述</span>
        </div>
        <div class="text">

        {!!$detail->content!!}

        </div>
    </div>
    @endsection